package com.lhh.myspringboot.java8;


import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;


public class Test01 {

    //重复注解

    @Retention(RetentionPolicy.RUNTIME)
    public @interface MyAnnotations {
        MyAnnotation [] value();
    }

    @MyAnnotation( "Hello")
    @MyAnnotation( "java")
    public interface Show {

    }

    @Repeatable(value = MyAnnotations.class) //指定容器类
    @interface MyAnnotation {
        String value();
    }



    public static void main(String[] args) throws NoSuchMethodException {
        MyAnnotation[] myAnnotations = Show.class.getAnnotationsByType(MyAnnotation.class);

        System.out.println("________________________");
        System.out.println(myAnnotations.length);
        for (MyAnnotation a : myAnnotations) {
            System.out.println(a.value());
            System.out.println(a.value());
        }
    }


 /*   @Schedule(dayOfMonth="last")
    @Schedule(dayOfWeek="Fri", hour= 22)
    public void doPeriodicCleanup() {
        System.out.println("doPeriodicCleanup");
    }
*/



}
